<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Filtering modifiers</title>
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../index.html" title="Chapter 1. The Variadic Macro Data Library 1.10">
<link rel="up" href="../vmd_modifiers.html" title="Macros with modifiers">
<link rel="prev" href="../vmd_modifiers.html" title="Macros with modifiers">
<link rel="next" href="vmd_modifiers_identifier.html" title="Identifier modifiers">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="../vmd_modifiers.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../vmd_modifiers.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="vmd_modifiers_identifier.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="variadic_macro_data.vmd_modifiers.vmd_modifiers_filter"></a><a class="link" href="vmd_modifiers_filter.html" title="Filtering modifiers">Filtering
      modifiers</a>
</h3></div></div></div>
<p>
        Filtering modifiers are optional modifiers which work with some generic macros
        to specify a type of data to apply to the macro's functionality. The filtering
        modifier itself is an optional parameter specified as a v-type. Any v-type,
        specified as an optional parameter, may be used as a filtering modifier.
      </p>
<h5>
<a name="variadic_macro_data.vmd_modifiers.vmd_modifiers_filter.h0"></a>
        <span class="phrase"><a name="variadic_macro_data.vmd_modifiers.vmd_modifiers_filter.usage_with_equality_macros"></a></span><a class="link" href="vmd_modifiers_filter.html#variadic_macro_data.vmd_modifiers.vmd_modifiers_filter.usage_with_equality_macros">Usage
        with equality macros</a>
      </h5>
<p>
        The equality macros, BOOST_VMD_EQUAL and BOOST_VMD_NOT_EQUAL, tests generically
        whether each of its two required inputs are equal or not equal to each other.
      </p>
<p>
        Each of these macro takes a single optional parameter, a filtering modifier,
        to narrow the focus of its equality testing to a particular v-type.
      </p>
<p>
        For the macro BOOST_VMD_EQUAL this optional parameter when specified means
        that equality is not only that the two required input parameters are equal
        but also that they are of the type or of a subtype of the third optional
        parameter. A number and a v-type are subtypes of identifiers while a non-empty
        list and an array are subtypes of tuples.
      </p>
<p>
        Conversely BOOST_VMD_NOT_EQUAL, with the optional third v-type parameter,
        returns 1 if either the first two parameters are not equal or if the type
        of the first two parameters is not the type or a subtype of the third parameter.
        Otherwise it returns 0. It is implemented as the complement of BOOST_VMD_EQUAL
        so that whenever BOOST_VMD_EQUAL returns 1, BOOST_VMD_NOT_EQUAL returns 0
        and vice versa.
      </p>
<p>
        Here is an example of using BOOST_VMD_EQUAL with a filtering modifier. BOOST_VMD_NOT_EQUAL
        is just the complement of the results in our example for each result, and
        would be redundant to be specified each time below.
      </p>
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">vmd</span><span class="special">/</span><span class="identifier">equal</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>

<span class="preprocessor">#define</span> <span class="identifier">BOOST_VMD_REGISTER_AN_ID1</span> <span class="special">(</span><span class="identifier">AN_ID1</span><span class="special">)</span>
<span class="preprocessor">#define</span> <span class="identifier">BOOST_VMD_REGISTER_AN_ID2</span> <span class="special">(</span><span class="identifier">AN_ID2</span><span class="special">)</span>

<span class="preprocessor">#define</span> <span class="identifier">BOOST_VMD_DETECT_AN_ID1_AN_ID1</span>
<span class="preprocessor">#define</span> <span class="identifier">BOOST_VMD_DETECT_AN_ID2_AN_ID2</span>

<span class="preprocessor">#define</span> <span class="identifier">AN_IDENTIFIER1</span> <span class="identifier">AN_ID1</span>
<span class="preprocessor">#define</span> <span class="identifier">AN_IDENTIFIER2</span> <span class="identifier">AN_ID2</span>
<span class="preprocessor">#define</span> <span class="identifier">AN_IDENTIFIER3</span> <span class="identifier">AN_ID1</span> <span class="comment">// same as AN_IDENTIFIER1 = AN_ID1</span>

<span class="preprocessor">#define</span> <span class="identifier">A_NUMBER1</span> <span class="number">33</span>
<span class="preprocessor">#define</span> <span class="identifier">A_NUMBER2</span> <span class="number">145</span>
<span class="preprocessor">#define</span> <span class="identifier">A_NUMBER3</span> <span class="number">33</span> <span class="comment">// same as A_NUMBER1 = 33</span>

<span class="preprocessor">#define</span> <span class="identifier">A_TUPLE1</span> <span class="special">(</span><span class="identifier">AN_IDENTIFIER1</span><span class="special">,</span><span class="identifier">A_NUMBER1</span><span class="special">)</span>
<span class="preprocessor">#define</span> <span class="identifier">A_TUPLE2</span> <span class="special">(</span><span class="identifier">AN_IDENTIFIER1</span><span class="special">,</span><span class="identifier">A_NUMBER2</span><span class="special">)</span>
<span class="preprocessor">#define</span> <span class="identifier">A_TUPLE3</span> <span class="special">(</span><span class="identifier">AN_IDENTIFIER3</span><span class="special">,</span><span class="identifier">A_NUMBER3</span><span class="special">)</span> <span class="comment">// same as A_TUPLE1 = (AN_ID1,33)</span>

<span class="preprocessor">#define</span> <span class="identifier">A_LIST1</span> <span class="special">(</span><span class="identifier">A_NUMBER1</span><span class="special">,(</span><span class="identifier">A_NUMBER3</span><span class="special">,</span><span class="identifier">BOOST_PP_NIL</span><span class="special">))</span>
<span class="preprocessor">#define</span> <span class="identifier">A_LIST2</span> <span class="special">(</span><span class="identifier">A_NUMBER1</span><span class="special">,(</span><span class="identifier">A_NUMBER2</span><span class="special">,</span><span class="identifier">BOOST_PP_NIL</span><span class="special">))</span>
<span class="preprocessor">#define</span> <span class="identifier">A_LIST3</span> <span class="special">(</span><span class="identifier">A_NUMBER1</span><span class="special">,(</span><span class="identifier">A_NUMBER3</span><span class="special">,</span><span class="identifier">BOOST_PP_NIL</span><span class="special">))</span>
<span class="preprocessor">#define</span> <span class="identifier">A_LIST4</span> <span class="identifier">BOOST_PP_NIL</span> <span class="comment">// empty list</span>
<span class="preprocessor">#define</span> <span class="identifier">A_LIST5</span> <span class="identifier">BOOST_PP_NIL</span> <span class="comment">// empty list</span>

<span class="identifier">BOOST_VMD_EQUAL</span><span class="special">(</span><span class="identifier">AN_IDENTIFIER1</span><span class="special">,</span><span class="identifier">AN_IDENTIFIER2</span><span class="special">,</span><span class="identifier">BOOST_VMD_TYPE_IDENTIFIER</span><span class="special">)</span> <span class="identifier">will</span> <span class="keyword">return</span> <span class="number">0</span>
<span class="identifier">BOOST_VMD_EQUAL</span><span class="special">(</span><span class="identifier">AN_IDENTIFIER1</span><span class="special">,</span><span class="identifier">AN_IDENTIFIER3</span><span class="special">,</span><span class="identifier">BOOST_VMD_TYPE_IDENTIFIER</span><span class="special">)</span> <span class="identifier">will</span> <span class="keyword">return</span> <span class="number">1</span>
<span class="identifier">BOOST_VMD_EQUAL</span><span class="special">(</span><span class="identifier">AN_IDENTIFIER1</span><span class="special">,</span><span class="identifier">AN_IDENTIFIER3</span><span class="special">,</span><span class="identifier">BOOST_VMD_TYPE_TYPE</span><span class="special">)</span> <span class="identifier">will</span> <span class="keyword">return</span> <span class="number">0</span> <span class="identifier">because</span> <span class="identifier">the</span> <span class="identifier">type</span> <span class="identifier">does</span> <span class="keyword">not</span> <span class="identifier">match</span>

<span class="identifier">BOOST_VMD_EQUAL</span><span class="special">(</span><span class="identifier">A_NUMBER1</span><span class="special">,</span><span class="identifier">A_NUMBER2</span><span class="special">,</span><span class="identifier">BOOST_VMD_TYPE_NUMBER</span><span class="special">)</span> <span class="identifier">will</span> <span class="keyword">return</span> <span class="number">0</span>
<span class="identifier">BOOST_VMD_EQUAL</span><span class="special">(</span><span class="identifier">A_NUMBER1</span><span class="special">,</span><span class="identifier">A_NUMBER3</span><span class="special">,</span><span class="identifier">BOOST_VMD_TYPE_NUMBER</span><span class="special">)</span> <span class="identifier">will</span> <span class="keyword">return</span> <span class="number">1</span>
<span class="identifier">BOOST_VMD_EQUAL</span><span class="special">(</span><span class="identifier">A_NUMBER1</span><span class="special">,</span><span class="identifier">A_NUMBER3</span><span class="special">,</span><span class="identifier">BOOST_VMD_TYPE_IDENTIFIER</span><span class="special">)</span> <span class="identifier">will</span> <span class="keyword">return</span> <span class="number">1</span> <span class="identifier">because</span> <span class="identifier">a</span> <span class="identifier">number</span> <span class="identifier">is</span> <span class="identifier">an</span> <span class="identifier">identifier</span>
<span class="identifier">BOOST_VMD_EQUAL</span><span class="special">(</span><span class="identifier">A_NUMBER1</span><span class="special">,</span><span class="identifier">A_NUMBER3</span><span class="special">,</span><span class="identifier">BOOST_VMD_TYPE_EMPTY</span><span class="special">)</span> <span class="identifier">will</span> <span class="keyword">return</span> <span class="number">0</span> <span class="identifier">because</span> <span class="identifier">the</span> <span class="identifier">type</span> <span class="identifier">does</span> <span class="keyword">not</span> <span class="identifier">match</span>

<span class="identifier">BOOST_VMD_EQUAL</span><span class="special">(</span><span class="identifier">A_TUPLE1</span><span class="special">,</span><span class="identifier">A_TUPLE2</span><span class="special">,</span><span class="identifier">BOOST_VMD_TYPE_TUPLE</span><span class="special">)</span> <span class="identifier">will</span> <span class="keyword">return</span> <span class="number">0</span>
<span class="identifier">BOOST_VMD_EQUAL</span><span class="special">(</span><span class="identifier">A_TUPLE1</span><span class="special">,</span><span class="identifier">A_TUPLE3</span><span class="special">,</span><span class="identifier">BOOST_VMD_TYPE_TUPLE</span><span class="special">)</span> <span class="identifier">will</span> <span class="keyword">return</span> <span class="number">1</span>
<span class="identifier">BOOST_VMD_EQUAL</span><span class="special">(</span><span class="identifier">A_TUPLE1</span><span class="special">,</span><span class="identifier">A_TUPLE3</span><span class="special">,</span><span class="identifier">BOOST_VMD_TYPE_ARRAY</span><span class="special">)</span> <span class="identifier">will</span> <span class="keyword">return</span> <span class="number">0</span> <span class="identifier">because</span> <span class="identifier">the</span> <span class="identifier">type</span> <span class="identifier">does</span> <span class="keyword">not</span> <span class="identifier">match</span>

<span class="identifier">BOOST_VMD_EQUAL</span><span class="special">(</span><span class="identifier">A_LIST1</span><span class="special">,</span><span class="identifier">A_LIST2</span><span class="special">,</span><span class="identifier">BOOST_VMD_TYPE_LIST</span><span class="special">)</span> <span class="identifier">will</span> <span class="keyword">return</span> <span class="number">0</span>
<span class="identifier">BOOST_VMD_EQUAL</span><span class="special">(</span><span class="identifier">A_LIST1</span><span class="special">,</span><span class="identifier">A_LIST3</span><span class="special">,</span><span class="identifier">BOOST_VMD_TYPE_LIST</span><span class="special">)</span> <span class="identifier">will</span> <span class="keyword">return</span> <span class="number">1</span>
<span class="identifier">BOOST_VMD_EQUAL</span><span class="special">(</span><span class="identifier">A_LIST1</span><span class="special">,</span><span class="identifier">A_LIST3</span><span class="special">,</span><span class="identifier">BOOST_VMD_TYPE_IDENTIFIER</span><span class="special">)</span> <span class="identifier">will</span> <span class="keyword">return</span> <span class="number">0</span> <span class="identifier">because</span> <span class="identifier">the</span> <span class="identifier">type</span> <span class="identifier">does</span> <span class="keyword">not</span> <span class="identifier">match</span>
<span class="identifier">BOOST_VMD_EQUAL</span><span class="special">(</span><span class="identifier">A_LIST1</span><span class="special">,</span><span class="identifier">A_LIST3</span><span class="special">,</span><span class="identifier">BOOST_VMD_TYPE_TUPLE</span><span class="special">)</span> <span class="identifier">will</span> <span class="keyword">return</span> <span class="number">1</span> <span class="identifier">because</span> <span class="identifier">a</span> <span class="identifier">non</span><span class="special">-</span><span class="identifier">empty</span> <span class="identifier">list</span> <span class="identifier">is</span> <span class="identifier">also</span> <span class="identifier">a</span> <span class="identifier">tuple</span>
<span class="identifier">BOOST_VMD_EQUAL</span><span class="special">(</span><span class="identifier">A_LIST4</span><span class="special">,</span><span class="identifier">A_LIST5</span><span class="special">,</span><span class="identifier">BOOST_VMD_TYPE_LIST</span><span class="special">)</span> <span class="identifier">will</span> <span class="keyword">return</span> <span class="number">1</span>
<span class="identifier">BOOST_VMD_EQUAL</span><span class="special">(</span><span class="identifier">A_LIST4</span><span class="special">,</span><span class="identifier">A_LIST5</span><span class="special">,</span><span class="identifier">BOOST_VMD_TYPE_IDENTIFIER</span><span class="special">)</span> <span class="identifier">will</span> <span class="keyword">return</span> <span class="number">1</span> <span class="identifier">because</span> <span class="identifier">an</span> <span class="identifier">empty</span> <span class="identifier">list</span> <span class="identifier">is</span> <span class="identifier">also</span> <span class="identifier">an</span> <span class="identifier">identifier</span>
<span class="identifier">BOOST_VMD_EQUAL</span><span class="special">(</span><span class="identifier">A_LIST4</span><span class="special">,</span><span class="identifier">A_LIST5</span><span class="special">,</span><span class="identifier">BOOST_VMD_TYPE_TUPLE</span><span class="special">)</span> <span class="identifier">will</span> <span class="keyword">return</span> <span class="number">0</span> <span class="identifier">because</span> <span class="identifier">an</span> <span class="identifier">empty</span> <span class="identifier">list</span> <span class="identifier">is</span> <span class="keyword">not</span> <span class="identifier">a</span> <span class="identifier">tuple</span>
</pre>
<h5>
<a name="variadic_macro_data.vmd_modifiers.vmd_modifiers_filter.h1"></a>
        <span class="phrase"><a name="variadic_macro_data.vmd_modifiers.vmd_modifiers_filter.usage_with_boost_vmd_elem"></a></span><a class="link" href="vmd_modifiers_filter.html#variadic_macro_data.vmd_modifiers.vmd_modifiers_filter.usage_with_boost_vmd_elem">Usage
        with BOOST_VMD_ELEM</a>
      </h5>
<p>
        As with the equality macros BOOST_VMD_ELEM allows one to perform filtering
        for the result. An optional parameter of a v-type can be used so that BOOST_VMD_ELEM
        returns its result only if the sequence element is of the v-type specified,
        else it fails to find the element in the same way that an element number
        which is outside the bounds of the sequence fails.
      </p>
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">vmd</span><span class="special">/</span><span class="identifier">elem</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>

<span class="preprocessor">#define</span> <span class="identifier">BOOST_VMD_REGISTER_ANAME</span> <span class="special">(</span><span class="identifier">ANAME</span><span class="special">)</span> <span class="comment">// an identifier must always be registered to be found by VMD</span>
<span class="preprocessor">#define</span> <span class="identifier">A_SEQUENCE</span> <span class="special">(</span><span class="number">1</span><span class="special">,</span><span class="number">2</span><span class="special">,</span><span class="number">3</span><span class="special">)</span> <span class="number">46</span> <span class="special">(</span><span class="identifier">list_data1</span><span class="special">,(</span><span class="identifier">list_data2</span><span class="special">,</span><span class="identifier">BOOST_PP_NIL</span><span class="special">))</span> <span class="identifier">BOOST_VMD_TYPE_SEQ</span> <span class="identifier">ANAME</span>

<span class="identifier">BOOST_VMD_ELEM</span><span class="special">(</span><span class="number">0</span><span class="special">,</span><span class="identifier">A_SEQUENCE</span><span class="special">)</span> <span class="identifier">will</span> <span class="keyword">return</span> <span class="special">(</span><span class="number">1</span><span class="special">,</span><span class="number">2</span><span class="special">,</span><span class="number">3</span><span class="special">)</span>
<span class="identifier">BOOST_VMD_ELEM</span><span class="special">(</span><span class="number">0</span><span class="special">,</span><span class="identifier">A_SEQUENCE</span><span class="special">,</span><span class="identifier">BOOST_VMD_TYPE_TUPLE</span><span class="special">)</span> <span class="identifier">will</span> <span class="keyword">return</span> <span class="special">(</span><span class="number">1</span><span class="special">,</span><span class="number">2</span><span class="special">,</span><span class="number">3</span><span class="special">)</span>
<span class="identifier">BOOST_VMD_ELEM</span><span class="special">(</span><span class="number">0</span><span class="special">,</span><span class="identifier">A_SEQUENCE</span><span class="special">,</span><span class="identifier">BOOST_VMD_TYPE_SEQ</span><span class="special">)</span> <span class="identifier">will</span> <span class="keyword">return</span> <span class="identifier">emptiness</span>

<span class="identifier">BOOST_VMD_ELEM</span><span class="special">(</span><span class="number">1</span><span class="special">,</span><span class="identifier">A_SEQUENCE</span><span class="special">)</span> <span class="identifier">will</span> <span class="keyword">return</span> <span class="number">46</span>
<span class="identifier">BOOST_VMD_ELEM</span><span class="special">(</span><span class="number">1</span><span class="special">,</span><span class="identifier">A_SEQUENCE</span><span class="special">,</span><span class="identifier">BOOST_VMD_TYPE_NUMBER</span><span class="special">)</span> <span class="identifier">will</span> <span class="keyword">return</span> <span class="number">46</span>
<span class="identifier">BOOST_VMD_ELEM</span><span class="special">(</span><span class="number">1</span><span class="special">,</span><span class="identifier">A_SEQUENCE</span><span class="special">,</span><span class="identifier">BOOST_VMD_TYPE_IDENTIFIER</span><span class="special">)</span> <span class="identifier">will</span> <span class="keyword">return</span> <span class="number">46</span> <span class="identifier">since</span> <span class="identifier">a</span> <span class="identifier">number</span> <span class="identifier">is</span> <span class="identifier">also</span> <span class="identifier">an</span> <span class="identifier">identifier</span>
<span class="identifier">BOOST_VMD_ELEM</span><span class="special">(</span><span class="number">1</span><span class="special">,</span><span class="identifier">A_SEQUENCE</span><span class="special">,</span><span class="identifier">BOOST_VMD_TYPE_LIST</span><span class="special">)</span> <span class="identifier">will</span> <span class="keyword">return</span> <span class="identifier">emptiness</span>

<span class="identifier">BOOST_VMD_ELEM</span><span class="special">(</span><span class="number">2</span><span class="special">,</span><span class="identifier">A_SEQUENCE</span><span class="special">)</span> <span class="identifier">will</span> <span class="keyword">return</span> <span class="special">(</span><span class="identifier">list_data1</span><span class="special">,(</span><span class="identifier">list_data2</span><span class="special">,</span><span class="identifier">BOOST_PP_NIL</span><span class="special">))</span>
<span class="identifier">BOOST_VMD_ELEM</span><span class="special">(</span><span class="number">2</span><span class="special">,</span><span class="identifier">A_SEQUENCE</span><span class="special">,</span><span class="identifier">BOOST_VMD_TYPE_LIST</span><span class="special">)</span> <span class="identifier">will</span> <span class="keyword">return</span> <span class="special">(</span><span class="identifier">list_data1</span><span class="special">,(</span><span class="identifier">list_data2</span><span class="special">,</span><span class="identifier">BOOST_PP_NIL</span><span class="special">))</span>
<span class="identifier">BOOST_VMD_ELEM</span><span class="special">(</span><span class="number">2</span><span class="special">,</span><span class="identifier">A_SEQUENCE</span><span class="special">,</span><span class="identifier">BOOST_VMD_TYPE_TUPLE</span><span class="special">)</span> <span class="identifier">will</span> <span class="keyword">return</span> <span class="special">(</span><span class="identifier">list_data1</span><span class="special">,(</span><span class="identifier">list_data2</span><span class="special">,</span><span class="identifier">BOOST_PP_NIL</span><span class="special">))</span> <span class="identifier">since</span> <span class="identifier">a</span> <span class="identifier">list</span> <span class="identifier">is</span> <span class="identifier">also</span> <span class="identifier">a</span> <span class="identifier">tuple</span>
<span class="identifier">BOOST_VMD_ELEM</span><span class="special">(</span><span class="number">2</span><span class="special">,</span><span class="identifier">A_SEQUENCE</span><span class="special">,</span><span class="identifier">BOOST_VMD_TYPE_TYPE</span><span class="special">)</span> <span class="identifier">will</span> <span class="keyword">return</span> <span class="identifier">emptiness</span>

<span class="identifier">BOOST_VMD_ELEM</span><span class="special">(</span><span class="number">3</span><span class="special">,</span><span class="identifier">A_SEQUENCE</span><span class="special">)</span> <span class="identifier">will</span> <span class="keyword">return</span> <span class="identifier">BOOST_VMD_TYPE_SEQ</span>
<span class="identifier">BOOST_VMD_ELEM</span><span class="special">(</span><span class="number">3</span><span class="special">,</span><span class="identifier">A_SEQUENCE</span><span class="special">,</span><span class="identifier">BOOST_VMD_TYPE_TYPE</span><span class="special">)</span> <span class="identifier">will</span> <span class="keyword">return</span> <span class="identifier">BOOST_VMD_TYPE_SEQ</span>
<span class="identifier">BOOST_VMD_ELEM</span><span class="special">(</span><span class="number">3</span><span class="special">,</span><span class="identifier">A_SEQUENCE</span><span class="special">,</span><span class="identifier">BOOST_VMD_TYPE_IDENTIFIER</span><span class="special">)</span> <span class="identifier">will</span> <span class="keyword">return</span> <span class="identifier">BOOST_VMD_TYPE_SEQ</span> <span class="identifier">since</span> <span class="identifier">a</span> <span class="identifier">type</span> <span class="identifier">is</span> <span class="identifier">also</span> <span class="identifier">an</span> <span class="identifier">identifier</span>
<span class="identifier">BOOST_VMD_ELEM</span><span class="special">(</span><span class="number">3</span><span class="special">,</span><span class="identifier">A_SEQUENCE</span><span class="special">,</span><span class="identifier">BOOST_VMD_TYPE_TUPLE</span><span class="special">)</span> <span class="identifier">will</span> <span class="keyword">return</span> <span class="identifier">emptiness</span>

<span class="identifier">BOOST_VMD_ELEM</span><span class="special">(</span><span class="number">4</span><span class="special">,</span><span class="identifier">A_SEQUENCE</span><span class="special">)</span> <span class="identifier">will</span> <span class="keyword">return</span> <span class="identifier">ANAME</span>
<span class="identifier">BOOST_VMD_ELEM</span><span class="special">(</span><span class="number">4</span><span class="special">,</span><span class="identifier">A_SEQUENCE</span><span class="special">,</span><span class="identifier">BOOST_VMD_TYPE_IDENTIFIER</span><span class="special">)</span> <span class="identifier">will</span> <span class="keyword">return</span> <span class="identifier">ANAME</span>
<span class="identifier">BOOST_VMD_ELEM</span><span class="special">(</span><span class="number">4</span><span class="special">,</span><span class="identifier">A_SEQUENCE</span><span class="special">,</span><span class="identifier">BOOST_VMD_TYPE_NUMBER</span><span class="special">)</span> <span class="identifier">will</span> <span class="keyword">return</span> <span class="identifier">emptiness</span>

<span class="identifier">BOOST_VMD_ELEM</span><span class="special">(</span><span class="number">0</span><span class="special">,</span><span class="identifier">BOOST_PP_NIL</span><span class="special">)</span> <span class="identifier">will</span> <span class="keyword">return</span> <span class="identifier">BOOST_PP_NIL</span>
<span class="identifier">BOOST_VMD_ELEM</span><span class="special">(</span><span class="number">0</span><span class="special">,</span><span class="identifier">BOOST_PP_NIL</span><span class="special">,</span><span class="identifier">BOOST_VMD_TYPE_LIST</span><span class="special">)</span> <span class="identifier">will</span> <span class="keyword">return</span> <span class="identifier">BOOST_PP_NIL</span> <span class="identifier">since</span> <span class="identifier">it</span> <span class="identifier">is</span> <span class="identifier">an</span> <span class="identifier">empty</span> <span class="identifier">list</span>
<span class="identifier">BOOST_VMD_ELEM</span><span class="special">(</span><span class="number">0</span><span class="special">,</span><span class="identifier">BOOST_PP_NIL</span><span class="special">,</span><span class="identifier">BOOST_VMD_TYPE_IDENTIFIER</span><span class="special">)</span> <span class="identifier">will</span> <span class="keyword">return</span> <span class="identifier">BOOST_PP_NIL</span> <span class="identifier">since</span> <span class="identifier">it</span> <span class="identifier">a</span> <span class="identifier">registered</span> <span class="identifier">identifier</span>
<span class="identifier">BOOST_VMD_ELEM</span><span class="special">(</span><span class="number">0</span><span class="special">,</span><span class="identifier">BOOST_PP_NIL</span><span class="special">,</span><span class="identifier">BOOST_VMD_TYPE_TUPLE</span><span class="special">)</span> <span class="identifier">will</span> <span class="keyword">return</span> <span class="identifier">emptiness</span>
</pre>
<p>
        If you specify more than one v-type as a filtering modifier to BOOST_VMD_ELEM
        the last v-type becomes the filter.
      </p>
<p>
        Filtering with BOOST_VMD_ELEM denotes the type of the data expected when
        the particular element is found. Because filtering represents the type of
        the data requested, filtering modifiers and return type modifiers are mutually
        exclusive and any filtering modifier means that return type modifiers specified
        are ignored.
      </p>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2010-2017 Tropic Software
      East Inc</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="../vmd_modifiers.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../vmd_modifiers.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="vmd_modifiers_identifier.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
